import { defineStore } from "pinia";
import { Login } from "../api/maneger.js";

export const useLoginStore = defineStore("loginInfo", {
  state: () => {
    return {
      Info: {},
      token:""
    };
  },
  actions: {
    getLoginInfo() {
      return Login()
        .then((res) => {
          this.Info = res.data.data.token;
          console.log(this.Info);
        })
        .catch((err) => {
          console.log(err);
        });
    },
    fun(){
      this.token = localStorage.token
    }
  },
});
